<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fnx" uri="http://java.sun.com/jsp/jstl/functionsx"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="f" uri="http://www.sctv.com/tags/form"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/views/head.jsp"/>
    <script type="text/javascript">
      $(function() {
        $("#validForm").validate({
          submitHandler: function(form) {
            $("#validForm input[name|='dy']").each(function() {
              var name = $(this).attr("name");
              $(this).attr("name",name.substring(3,name.lastIndexOf("-")));
            });
            form.submit();
          }
        });
        $("input[name='name']").focus();

        $("#pagedTable tbody tr").dblclick(function(eventObj) {
          var nodeName = eventObj.target.nodeName.toLowerCase();
          if(nodeName!="input"&&nodeName!="select"&&nodeName!="textarea") {
            location.href=$("#edit_opt_"+$(this).attr("beanid")).attr('href');
          }
        });
      });
      function confirmDelete() {
        return confirm("<s:message code='confirmDelete'/>");
      }
    </script>
</head>
<body class="skin-blue content-body">
<jsp:include page="/WEB-INF/views/commons/show_message.jsp"/>
<div class="content-header">
    <h1><s:message code="vote.management"/> - 查看</h1>
</div>
<div class="content">
    <div class="box box-primary">
        <form class="form-horizontal" id="validForm" action="${oprt=='edit' ? 'update' : 'save'}.do" method="post">
            <tags:search_params/>
            <f:hidden name="oid" value="${bean.id}"/>
            <f:hidden name="position" value="${position}"/>
            <input type="hidden" id="redirect" name="redirect" value="edit"/>
            <div class="box-header with-border">
                <div class="btn-toolbar">
                    <div class="btn-group">
                        <button class="btn btn-default" type="button" onclick="location.href='list.do?${searchstring}';"><s:message code="return"/></button>
                    </div>
                </div>
            </div>
            <div class="box-body">
                <h4>投票标题:&nbsp;${bean.title} <small>(共<span style="color:red;">${bean.total}</span>人次参与)</small></h4>
                <h4>结束时间:&nbsp;${bean.endDate}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;投票类型:&nbsp;<s:message code="autonym.${bean.type}"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                投票选项:&nbsp;<s:message code="yes.${bean.maxSelected}"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总票数:&nbsp;${bean.total}票</h4>
                <h4>
                    投票选项:
                    <ul style="list-style:none;">
                        <c:forEach var="item" items="${bean.options}" varStatus="status">
                            <li>
                                <ul style="list-style:none;">
                                    <li>
                                        ${item.title} <span style="font-weight:normal;">(<span style="color:red;">${item.count}</span>票)</span>
                                    </li>
                                </ul>
                            </li>
                        </c:forEach>
                    </ul>
                </h4>
            </div>
        </form>
    </div>
</div>
</body>
</html>